package main.java.com.lee.atomic;

import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;

/**
 * @Description TODO
 * @Author winston
 * @DateTime 2021/12/27
 */
public class AtomicIntegerFieldUpdateTest {
    public static void main(String[] args) {
        AtomicIntegerFieldUpdater<User> age = AtomicIntegerFieldUpdater.newUpdater(User.class, "age");
        User user = new User();
        user.setAge(1);
        age.getAndIncrement(user);
        int i = age.get(user);
    }
}
